

from django.core.management.base import BaseCommand
from django_seed import Seed
from app01.models import PhonoManageInfo
import string
import random

# class Command(BaseCommand):
#     help = 'Create random PhonoManageInfo entries'
#
#     def add_arguments(self, parser):
#         parser.add_argument('total', type=int, help='Indicates the number of PhonoManageInfo to be created')
#
#     def handle(self, *args, **kwargs):
#         total = kwargs['total']
#         seeder = Seed.seeder()
#
#         def generate_phone_number():
#             return ''.join([str(random.randint(0, 9)) for _ in range(11)])
#
#         def generate_random_string(length):
#             letters = string.ascii_lowercase + string.digits
#             return ''.join(random.choice(letters) for i in range(length))
#
#         seeder.add_entity(PhonoManageInfo, total, {
#             'project': lambda x: generate_random_string(20),
#             'phono': generate_phone_number,
#             'claid': lambda x: generate_random_string(10),
#             'username': lambda x: generate_random_string(10),
#             'remark': lambda x: generate_random_string(20),
#             'statu': lambda x: random.randint(1, 2),  # 随机选择状态
#         })
#
#         inserted_pks = seeder.execute()
#         self.stdout.write(self.style.SUCCESS('Successfully created %d PhonoManageInfo entries' % total))


